\(\int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx\) [198]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [F]
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 320 \[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=-\frac {2 (a-b) \sqrt {a+b} d \cot (e+f x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{b f}+\frac {2 \sqrt {a+b} (b (c-d)+a d) \cot (e+f x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{b f}-\frac {2 \sqrt {a+b} c \cot (e+f x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{f} \]

[Out]

-2*(a-b)*d*cot(f*x+e)*EllipticE((a+b*sec(f*x+e))^(1/2)/(a+b)^(1/2),((a+b)/(a-b))^(1/2))*(a+b)^(1/2)*(b*(1-sec(
f*x+e))/(a+b))^(1/2)*(-b*(1+sec(f*x+e))/(a-b))^(1/2)/b/f+2*(b*(c-d)+a*d)*cot(f*x+e)*EllipticF((a+b*sec(f*x+e))
^(1/2)/(a+b)^(1/2),((a+b)/(a-b))^(1/2))*(a+b)^(1/2)*(b*(1-sec(f*x+e))/(a+b))^(1/2)*(-b*(1+sec(f*x+e))/(a-b))^(
1/2)/b/f-2*c*cot(f*x+e)*EllipticPi((a+b*sec(f*x+e))^(1/2)/(a+b)^(1/2),(a+b)/a,((a+b)/(a-b))^(1/2))*(a+b)^(1/2)
*(b*(1-sec(f*x+e))/(a+b))^(1/2)*(-b*(1+sec(f*x+e))/(a-b))^(1/2)/f

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 320, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {4001, 3869, 4090, 3917, 4089} \[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\frac {2 \sqrt {a+b} (a d+b (c-d)) \cot (e+f x) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (\sec (e+f x)+1)}{a-b}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{b f}-\frac {2 c \sqrt {a+b} \cot (e+f x) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (\sec (e+f x)+1)}{a-b}} \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{f}-\frac {2 d (a-b) \sqrt {a+b} \cot (e+f x) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (\sec (e+f x)+1)}{a-b}} E\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{b f} \]

[In]

Int[Sqrt[a + b*Sec[e + f*x]]*(c + d*Sec[e + f*x]),x]

[Out]

(-2*(a - b)*Sqrt[a + b]*d*Cot[e + f*x]*EllipticE[ArcSin[Sqrt[a + b*Sec[e + f*x]]/Sqrt[a + b]], (a + b)/(a - b)
]*Sqrt[(b*(1 - Sec[e + f*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[e + f*x]))/(a - b))])/(b*f) + (2*Sqrt[a + b]*(b*(c -
 d) + a*d)*Cot[e + f*x]*EllipticF[ArcSin[Sqrt[a + b*Sec[e + f*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 -
Sec[e + f*x]))/(a + b)]*Sqrt[-((b*(1 + Sec[e + f*x]))/(a - b))])/(b*f) - (2*Sqrt[a + b]*c*Cot[e + f*x]*Ellipti
cPi[(a + b)/a, ArcSin[Sqrt[a + b*Sec[e + f*x]]/Sqrt[a + b]], (a + b)/(a - b)]*Sqrt[(b*(1 - Sec[e + f*x]))/(a +
 b)]*Sqrt[-((b*(1 + Sec[e + f*x]))/(a - b))])/f

Rule 3869

Int[1/Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[2*(Rt[a + b, 2]/(a*d*Cot[c + d*x]))*Sqrt[b
*((1 - Csc[c + d*x])/(a + b))]*Sqrt[(-b)*((1 + Csc[c + d*x])/(a - b))]*EllipticPi[(a + b)/a, ArcSin[Sqrt[a + b
*Csc[c + d*x]]/Rt[a + b, 2]], (a + b)/(a - b)], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]

Rule 3917

Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Simp[-2*(Rt[a + b, 2]/(b*
f*Cot[e + f*x]))*Sqrt[(b*(1 - Csc[e + f*x]))/(a + b)]*Sqrt[(-b)*((1 + Csc[e + f*x])/(a - b))]*EllipticF[ArcSin
[Sqrt[a + b*Csc[e + f*x]]/Rt[a + b, 2]], (a + b)/(a - b)], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 - b^2, 0]

Rule 4001

Int[Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)]*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Dist[a*c,
Int[1/Sqrt[a + b*Csc[e + f*x]], x], x] + Int[Csc[e + f*x]*((b*c + a*d + b*d*Csc[e + f*x])/Sqrt[a + b*Csc[e + f
*x]]), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0]

Rule 4089

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)
], x_Symbol] :> Simp[-2*(A*b - a*B)*Rt[a + b*(B/A), 2]*Sqrt[b*((1 - Csc[e + f*x])/(a + b))]*(Sqrt[(-b)*((1 + C
sc[e + f*x])/(a - b))]/(b^2*f*Cot[e + f*x]))*EllipticE[ArcSin[Sqrt[a + b*Csc[e + f*x]]/Rt[a + b*(B/A), 2]], (a
*A + b*B)/(a*A - b*B)], x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[a^2 - b^2, 0] && EqQ[A^2 - B^2, 0]

Rule 4090

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)
], x_Symbol] :> Dist[A - B, Int[Csc[e + f*x]/Sqrt[a + b*Csc[e + f*x]], x], x] + Dist[B, Int[Csc[e + f*x]*((1 +
 Csc[e + f*x])/Sqrt[a + b*Csc[e + f*x]]), x], x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[a^2 - b^2, 0] && NeQ[A
^2 - B^2, 0]

Rubi steps \begin{align*} \text {integral}& = (a c) \int \frac {1}{\sqrt {a+b \sec (e+f x)}} \, dx+\int \frac {\sec (e+f x) (b c+a d+b d \sec (e+f x))}{\sqrt {a+b \sec (e+f x)}} \, dx \\ & = -\frac {2 \sqrt {a+b} c \cot (e+f x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{f}+(b d) \int \frac {\sec (e+f x) (1+\sec (e+f x))}{\sqrt {a+b \sec (e+f x)}} \, dx+(b (c-d)+a d) \int \frac {\sec (e+f x)}{\sqrt {a+b \sec (e+f x)}} \, dx \\ & = -\frac {2 (a-b) \sqrt {a+b} d \cot (e+f x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{b f}+\frac {2 \sqrt {a+b} (b (c-d)+a d) \cot (e+f x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{b f}-\frac {2 \sqrt {a+b} c \cot (e+f x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (e+f x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (e+f x))}{a+b}} \sqrt {-\frac {b (1+\sec (e+f x))}{a-b}}}{f} \\ \end{align*}

Mathematica [A] (verified)

Time = 10.20 (sec) , antiderivative size = 379, normalized size of antiderivative = 1.18 \[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\frac {\cos (e+f x) \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \left (2 d \sin (e+f x)-\frac {\cos ^2\left (\frac {1}{2} (e+f x)\right ) \left (4 (a+b) d \sqrt {\frac {\cos (e+f x)}{1+\cos (e+f x)}} \sqrt {\frac {b+a \cos (e+f x)}{(a+b) (1+\cos (e+f x))}} E\left (\arcsin \left (\tan \left (\frac {1}{2} (e+f x)\right )\right )|\frac {a-b}{a+b}\right )+4 (a (c-d)-b (c+d)) \sqrt {\frac {\cos (e+f x)}{1+\cos (e+f x)}} \sqrt {\frac {b+a \cos (e+f x)}{(a+b) (1+\cos (e+f x))}} \operatorname {EllipticF}\left (\arcsin \left (\tan \left (\frac {1}{2} (e+f x)\right )\right ),\frac {a-b}{a+b}\right )-8 a c \sqrt {\frac {\cos (e+f x)}{1+\cos (e+f x)}} \sqrt {\frac {b+a \cos (e+f x)}{(a+b) (1+\cos (e+f x))}} \operatorname {EllipticPi}\left (-1,\arcsin \left (\tan \left (\frac {1}{2} (e+f x)\right )\right ),\frac {a-b}{a+b}\right )+d (b+a \cos (e+f x)) \sec ^3\left (\frac {1}{2} (e+f x)\right ) \left (-\sin \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {3}{2} (e+f x)\right )\right )\right )}{b+a \cos (e+f x)}\right )}{f (d+c \cos (e+f x))} \]

[In]

Integrate[Sqrt[a + b*Sec[e + f*x]]*(c + d*Sec[e + f*x]),x]

[Out]

(Cos[e + f*x]*Sqrt[a + b*Sec[e + f*x]]*(c + d*Sec[e + f*x])*(2*d*Sin[e + f*x] - (Cos[(e + f*x)/2]^2*(4*(a + b)
*d*Sqrt[Cos[e + f*x]/(1 + Cos[e + f*x])]*Sqrt[(b + a*Cos[e + f*x])/((a + b)*(1 + Cos[e + f*x]))]*EllipticE[Arc
Sin[Tan[(e + f*x)/2]], (a - b)/(a + b)] + 4*(a*(c - d) - b*(c + d))*Sqrt[Cos[e + f*x]/(1 + Cos[e + f*x])]*Sqrt
[(b + a*Cos[e + f*x])/((a + b)*(1 + Cos[e + f*x]))]*EllipticF[ArcSin[Tan[(e + f*x)/2]], (a - b)/(a + b)] - 8*a
*c*Sqrt[Cos[e + f*x]/(1 + Cos[e + f*x])]*Sqrt[(b + a*Cos[e + f*x])/((a + b)*(1 + Cos[e + f*x]))]*EllipticPi[-1
, ArcSin[Tan[(e + f*x)/2]], (a - b)/(a + b)] + d*(b + a*Cos[e + f*x])*Sec[(e + f*x)/2]^3*(-Sin[(e + f*x)/2] +
Sin[(3*(e + f*x))/2])))/(b + a*Cos[e + f*x])))/(f*(d + c*Cos[e + f*x]))

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(1248\) vs. \(2(293)=586\).

Time = 20.48 (sec) , antiderivative size = 1249, normalized size of antiderivative = 3.90

method result size
parts \(\text {Expression too large to display}\) \(1249\)
default \(\text {Expression too large to display}\) \(1840\)

[In]

int((c+d*sec(f*x+e))*(a+b*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*c/f*(cos(f*x+e)+1)*(EllipticF(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*a-EllipticF(cot(f*x+e)-csc(f*x+e),(
(a-b)/(a+b))^(1/2))*b-2*a*EllipticPi(cot(f*x+e)-csc(f*x+e),-1,((a-b)/(a+b))^(1/2)))*(1/(a+b)*(b+a*cos(f*x+e))/
(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(a+b*sec(f*x+e))^(1/2)/(b+a*cos(f*x+e))-2*d/f*(Ellipti
cF(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos
(f*x+e)+1))^(1/2)*a*cos(f*x+e)^2+EllipticF(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+a*cos(f*x+e)
)/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*b*cos(f*x+e)^2-(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)
+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*EllipticE(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*a*cos(f*x+e)
^2-(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*EllipticE(cot(f*x+e)-csc(
f*x+e),((a-b)/(a+b))^(1/2))*b*cos(f*x+e)^2+2*EllipticF(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+
a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*a*cos(f*x+e)+2*EllipticF(cot(f*x+e)-csc(
f*x+e),((a-b)/(a+b))^(1/2))*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*
b*cos(f*x+e)-2*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*EllipticE(cot
(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*a*cos(f*x+e)-2*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*
x+e)/(cos(f*x+e)+1))^(1/2)*EllipticE(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*b*cos(f*x+e)+EllipticF(cot(f*x
+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1)
)^(1/2)*a+EllipticF(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(1/(a+b)*(b+a
*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*b-(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2)*(cos(f*x+e)/(cos(f*x+e)+1
))^(1/2)*EllipticE(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*a-(1/(a+b)*(b+a*cos(f*x+e))/(cos(f*x+e)+1))^(1/2
)*(cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*EllipticE(cot(f*x+e)-csc(f*x+e),((a-b)/(a+b))^(1/2))*b-cos(f*x+e)*sin(f*x+
e)*a-sin(f*x+e)*b)*(a+b*sec(f*x+e))^(1/2)/(b+a*cos(f*x+e))/(cos(f*x+e)+1)

Fricas [F]

\[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\int { \sqrt {b \sec \left (f x + e\right ) + a} {\left (d \sec \left (f x + e\right ) + c\right )} \,d x } \]

[In]

integrate((c+d*sec(f*x+e))*(a+b*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

integral(sqrt(b*sec(f*x + e) + a)*(d*sec(f*x + e) + c), x)

Sympy [F]

\[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\int \sqrt {a + b \sec {\left (e + f x \right )}} \left (c + d \sec {\left (e + f x \right )}\right )\, dx \]

[In]

integrate((c+d*sec(f*x+e))*(a+b*sec(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(a + b*sec(e + f*x))*(c + d*sec(e + f*x)), x)

Maxima [F]

\[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\int { \sqrt {b \sec \left (f x + e\right ) + a} {\left (d \sec \left (f x + e\right ) + c\right )} \,d x } \]

[In]

integrate((c+d*sec(f*x+e))*(a+b*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(b*sec(f*x + e) + a)*(d*sec(f*x + e) + c), x)

Giac [F]

\[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\int { \sqrt {b \sec \left (f x + e\right ) + a} {\left (d \sec \left (f x + e\right ) + c\right )} \,d x } \]

[In]

integrate((c+d*sec(f*x+e))*(a+b*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(b*sec(f*x + e) + a)*(d*sec(f*x + e) + c), x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {a+b \sec (e+f x)} (c+d \sec (e+f x)) \, dx=\int \sqrt {a+\frac {b}{\cos \left (e+f\,x\right )}}\,\left (c+\frac {d}{\cos \left (e+f\,x\right )}\right ) \,d x \]

[In]

int((a + b/cos(e + f*x))^(1/2)*(c + d/cos(e + f*x)),x)

[Out]

int((a + b/cos(e + f*x))^(1/2)*(c + d/cos(e + f*x)), x)